
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
  <head>
     <title>Cookie信息处理·写</title>
   </head>  
  <body>
    <%
     	Cookie myCookie1=new Cookie("xm","wzx"); //创建对象
      	Cookie myCookie2=new Cookie("pwd","abc123");
		myCookie1.setMaxAge(5); //设置存活时间（有效期）为5秒
		myCookie2.setMaxAge(15); //设置存活时间（有效期）为5秒
 		response.addCookie(myCookie1); //写入客户端硬盘
 		response.addCookie(myCookie2);
 		out.write("已经成功建立了两个自定义的Cookie信息!");
     %>
     	<a href="example2_2_4r.jsp">重新获取Cookie信息</a>
  </body>
</html>


